//////////////////////////////////////////////////////////////////////////////
//                                                                          //
//     Filename: CRXMLTranslator.h                                          //
//  Create date: December 13, 2004                                          //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////
//                                                                          //
//  Description: This file describes the CRXMLTranslator class.  This class//
//                is a protocol translator that translates from the RTG     //
//                Roulette  protocol to XML and back.                       //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////
//       Copyright (c) 2004 - Realtime Gaming.  All rights reserved.        //
//////////////////////////////////////////////////////////////////////////////

#ifndef __CR_XML_TRANSLATOR__
#define __CR_XML_TRANSLATOR__

#include "XMLTranslator.h"

//////////////////////////////////////////////////////////////////////////////
// CRXMLTranslator Class
//////////////////////////////////////////////////////////////////////////////
class CRXMLTranslator : public XMLTranslator
{
public:
    CRXMLTranslator( Server* pServer, Connection* pParent );
    virtual ~CRXMLTranslator();

    // Public Interface
    virtual bool8  TranslateIncomingMessage( uint8* pGameInBuff,  uint32 nGameInBuffSize, uint8* pBuff, uint32 nOutBuffSize );
    virtual uint32 TranslateOutgoingMessage( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize, uint32 nTotalGameBytes );

protected:
	// Incoming
	bool8 TranslateInLogin  ( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );
	bool8 TranslateInRoll   ( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );

	// Outgoing
	bool8 TranslateOutLogin   ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutRoll    ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutError   ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );

};

#endif //#ifndef __CR_XML_TRANSLATOR__